Radiative Equilibrium


This demo steps the grey radiation code forward in time to get a radiative equilibrium profile. The surface temperature is 283 K, and the maximum atmospheric temperature is around 255 K, making this profile highly unstable without a boundary layer or convection.


In [5]:
%matplotlib notebook
import numpy as np
import climt

# Federation
kwargs = {}
kwargs['alpha'] = 4.

kwargs['MonitorFields'] = ['T']
kwargs['solin'] = 400.
rad = climt.radiation(scheme='newgreygas', **kwargs)

# -- Initial fields (temp is set to skin temp)
kwargs['T'] = np.zeros(rad.nlev) + (kwargs['solin']/2./5.67e-8)**0.25

rad['T'] = kwargs['T']

for i in range(100000):
    rad.step()


---------------------------------------------------------------------------
KeyboardInterrupt                         Traceback (most recent call last)
<ipython-input-5-8d43b554d16e> in <module>()
     17 
     18 for i in range(100000):
---> 19     rad.step()

/home/joymm/github/joyClimt/lib/python2.7/site-packages/climt/component.pyc in step(self, RunLength, Inc)
    214                 freq = self.Monitor.MonitorFreq
    215                 if int(time/freq) != int((time-dt)/freq):
--> 216                     self.Monitor.refresh(self)
    217 
    218     def __call__(self,**kwargs):

/home/joymm/github/joyClimt/lib/python2.7/site-packages/climt/plot.pyc in refresh(self, Component)
    174 
    175         # Redraw figure
--> 176         self.manager.canvas.draw()
    177 
    178 class Panel:

/usr/local/lib/python2.7/dist-packages/matplotlib/backends/backend_webagg_core.pyc in draw(self)
    180             backend_agg.RendererAgg.lock.release()
    181             # Swap the frames
--> 182             self.manager.refresh_all()
    183 
    184     def draw_idle(self):

/usr/local/lib/python2.7/dist-packages/matplotlib/backends/backend_webagg_core.pyc in refresh_all(self)
    471     def refresh_all(self):
    472         if self.web_sockets:
--> 473             diff = self.canvas.get_diff_image()
    474             for s in self.web_sockets:
    475                 s.send_binary(diff)

/usr/local/lib/python2.7/dist-packages/matplotlib/backends/backend_webagg_core.pyc in get_diff_image(self)
    237             _png.write_png(
    238                 output.view(dtype=np.uint8).reshape(output.shape + (4,)),
--> 239                 self._png_buffer)
    240 
    241             # Swap the renderer frames

KeyboardInterrupt: 

In [4]:
rad['Ts']


Out[4]:
array(283.15)